import request from "@/utils/request";

import accountStatus from "./accountStatus.json";
import businessPrimaryTypeId from "./businessPrimaryTypeId.json";
import businessSecondaryTypeId from "./businessSecondaryTypeId.json";
import businessType from "./businessType.json";
import certificatesType from "./certificatesType.json";
import fileType from "./fileType.json";
import htAccArea from "./htAccArea.json";
import htBindCardFlag from "./htBindCardFlag.json";
import htBusinessType from "./htBusinessType.json";
import htCityCode from "./htCityCode.json";
import htCountry from "./htCountry.json";
import htEconomicNature from "./htEconomicNature.json";
import htEnterpriseScale from "./htEnterpriseScale.json";
import htEnterpriseType from "./htEnterpriseType.json";
import htListingType from "./htListingType.json";
import htOccupation from "./htOccupation.json";
import industryType from "./industryType.json";
import merchantApplyStep from "./merchantApplyStep.json";
import merchantStep from "./merchantStep.json";
import productApplyStep from "./productApplyStep.json";

export const baofuAccountStatus = accountStatus;
export const baofuBusinessPrimaryTypeId = businessPrimaryTypeId;
export const baofuBusinessSecondaryTypeId = businessSecondaryTypeId;
export const baofuBusinessType = businessType;
export const baofuCertificatesType = certificatesType;
export const baofuFileType = fileType;
export const baofuHtAccArea = htAccArea;
export const baofuHtBindCardFlag = htBindCardFlag;
export const baofuHtBusinessType = htBusinessType;
export const baofuHtCityCode = htCityCode;
export const baofuHtCountry = htCountry;
export const baofuHtEconomicNature = htEconomicNature;
export const baofuHtEnterpriseScale = htEnterpriseScale;
export const baofuHtEnterpriseType = htEnterpriseType;
export const baofuHtListingType = htListingType;
export const baofuHtOccupation = htOccupation;
export const baofuIndustryType = industryType;
export const baofuMerchantApplyStep = merchantApplyStep;
export const baofuMerchantStep = merchantStep;
export const baofuProductApplyStep = productApplyStep;

export function listBaofuMerchant(params) {
  return request({
    url: "/ecs/baofu/list",
    method: "get",
    params,
  });
}

export function findBaofuMerchant(id) {
  return request({
    url: `/ecs/baofu/${id}`,
    method: "get",
  });
}

export function addBaofuMerchant(data) {
  return request({
    url: "/ecs/baofu",
    method: "post",
    data,
  });
}

export function editBaofuMerchant(data) {
  return request({
    url: `/ecs/baofu/${data.id}`,
    method: "put",
    data,
  });
}

export function editBaofuMerchantFeeRate(data) {
  return request({
    url: `/ecs/baofu/editFeeRate`,
    method: "put",
    data,
  });
}

export function submitBaofuMerchant(data) {
  return request({
    url: `/ecs/baofu/submit/${data.id}`,
    method: "post",
  });
}

export function signMailBaofuMerchant(data) {
  return request({
    url: `/ecs/baofu/sign-mail/${data.id}`,
    method: "post",
  });
}

export function bankAccountBaofuMerchant(data) {
  return request({
    url: `/ecs/baofu/bank-account/${data.id}`,
    method: "post",
  });
}
